package com.oocl.service.impl;

import com.oocl.dao.CustomerDao;
import com.oocl.dao.impl.CustomerDaoImpl;
import com.oocl.pojo.Customer;
import com.oocl.service.CustomerManager;

public class CustomerManagerImpl implements CustomerManager {
	private CustomerDao customerDao;
	
	public CustomerManagerImpl(){
		this.customerDao=new CustomerDaoImpl();
	}
	
	@Override
	public int addCustomer(Customer c) {
		int n = customerDao.addCustomer(c);
		return n;
	}

	@Override
	public int findCustomer(String cName,String cpwd) {
		Customer c = customerDao.findCustomerByName(cName);
		if(c==null)return -1;
		if(!cpwd.equals(c.getcPwd()))return 0;
		return 1;
	}
	
	

}
